import request from 'src/utils/request' // 添加拦截器


// 查询工单的信息列表
export function getordersTableList(query) {
    return request({
        url: '/product-mang/orders/list/',
        method: 'get',
        params: query
    })
}

// 查询报工的列表信息
export function getrecordsTableList(query) {
    return request({
        url: '/product-mang/report/records/list/',
        method: 'get',
        params: query
    })
}

// 查询任务的列表信息
export function gettasksTableList(query) {
    return request({
        url: '/product-mang/tasks/list/',
        method: 'get',
        params: query
    })
}

// 查询任务对应机台的列表信息
export function getequipTableList(query) {
    return request({
        url: '/product-mang/report/equip-set/list/',
        method: 'get',
        params: query
    })
}

// 查询任务报工人员的列表信息
export function getreporterTableList(query) {
    return request({
        url: '/product-mang/report/reporter-set/list/',
        method: 'get',
        params: query
    })
}

// 获取一条在产工单进度的信息
export function getprocessChart(query) {
    return request({
        url: '/product-mang/orders/process/',
        method: 'get',
        params: query
    })
}

// 获取一条历史产量的信息
export function getrecordsChart(query) {
    return request({
        url: '/product-mang/report/records/history/',
        method: 'get',
        params: query
    })
}

// 获取一条员工绩效的信息
export function getperformanceChart(query) {
    return request({
        url: '/product-mang/report/records/performance/',
        method: 'get',
        params: query
    })
}

// 增加一条工单的信息
export function addorders(data) {
    return request({
        url: '/product-mang/orders/',
        method: 'post',
        data
    })
}

// 增加一条报工的信息
export function addrecords(data) {
    return request({
        url: '/product-mang/report/records/',
        method: 'post',
        data
    })
}

// 增加一条任务的信息
export function addtasks(data) {
    return request({
        url: '/product-mang/tasks/',
        method: 'post',
        data
    })
}

// 增加一条任务对应机台的信息
export function addequip(data) {
    return request({
        url: '/product-mang/report/equip-set/',
        method: 'post',
        data
    })
}

// 增加一条任务报工人员的信息
export function addreporter(data) {
    return request({
        url: '/product-mang/report/reporter-set/',
        method: 'post',
        data
    })
}

// 修改一条工单的信息
export function redactorders(id, data) {
    return request({
        url: `/product-mang/orders/${id}/`,
        method: 'patch',
        data
    })
}

// 修改一条报工的信息
export function redactrecords(id, data) {
    return request({
        url: `/product-mang/report/records/${id}/`,
        method: 'patch',
        data
    })
}

// 修改一条任务的信息
export function redacttasks(id, data) {
    return request({
        url: `/product-mang/tasks/${id}/`,
        method: 'patch',
        data
    })
}

// 修改一条任务对应机台的信息
export function redactequip(id, data) {
    return request({
        url: `/product-mang/report/equip-set/${id}/`,
        method: 'patch',
        data
    })
}

// 修改一条任务报工人员的信息
export function redactreporter(id, data) {
    return request({
        url: `/product-mang/report/reporter-set/${id}/`,
        method: 'patch',
        data
    })
}

// 操作一条工单的信息
export function operate(id, data) {
    return request({
        url: `/product-mang/orders/operate/${id}/`,
        method: 'patch',
        data
    })
}

// 删除一条工单的信息
export function deleteorders(id) {
    return request({
        url: `/product-mang/orders/${id}/`,
        method: 'delete'
    })
}

// 删除一条报工的信息
export function deleterecords(id) {
    return request({
        url: `/product-mang/report/records/${id}/`,
        method: 'delete'
    })
}

// 删除一条任务的信息
export function deletetasks(id) {
    return request({
        url: `/product-mang/tasks/${id}/`,
        method: 'delete'
    })
}

// 删除一条任务对应机台的信息
export function deleteequip(id) {
    return request({
        url: `/product-mang/report/equip-set/${id}/`,
        method: 'delete'
    })
}

// 删除一条任务对应人员的信息
export function deletereporter(id) {
    return request({
        url: `/product-mang/report/reporter-set/${id}/`,
        method: 'delete'
    })
}